Line 2 is the usual R-GMA import statement for python.

Line 3--4 are the start of a try block to ensure that close is called if the
secondary prodcuer exists. Note that it is only from python 2.5 that try
can have both except and finally in the same block.

Line 5 starts the inner try block

Lines 6--8 create the secondary producer. In
this case we have specified a termination interval of 60 minutes with 
a logical database (pythonExample) providing support for continuous and latest
queries.

Lines 9--12 declare a table that the secondary producer will deal
with. The predicate is an empty string meaning that this
secondary producer will collect and republish the whole table. The
history retention period is set to 2 hours. This means that tuples
will be available until they are 2 hours old - these tuples will be
made available to both continuous and latest queries.

Lines 13--16 keep the secondary producer alive. The termination interval is
looked up and a show sign of line is sent more frequently.

Lines 17--19 report any exceptions that may occur.

Lines 20--22 the finally clause shuts down the secondary producer. If
you do not provide this protection the secondary producer will
continue to function until the termination interval has expired.

Notice that if the secondary producer does fail it will not be noted until
showSignOfLife is called again, so you need to set the retention period 
and sleep parameter according to your needs.

\input{disconnectedSP}
